#!/usr/bin/python
# -*- coding: utf-8 -*-

from web.response import Response
from web.request import Request
from web.session import Session
import utils.common

class LogoutHandler(object):
    @utils.common.auth
    def handle(self, req, resp):  
        session = Session(req)
        session.invalidate()
        resp.clear_cookie('s_id')
        return resp.redirect(req, '/demo/login')


